ARM		:= arm-linux-gnueabihf-
NAME	:= led

GCC 	:= $(ARM)gcc
LD		:= $(ARM)ld
OBJCOPY := $(ARM)objcopy
OBJDUMP := $(ARM)objdump

OBJS := start.o main.o

$(NAME).bin : $(OBJS)
	$(LD) -Ttext 0x87800000 $^ -o $(NAME).elf
	$(OBJCOPY) -O binary -S -g $(NAME).elf $@
	$(OBJDUMP) -D $(NAME).elf > $(NAME).dis

%.o : %.s
	$(GCC) -g -c $< -o $@

%.o : %.c
	$(GCC) -g -c $< -o $@	

clean:
	rm -rf *.o $(NAME).bin $(NAME).elf $(NAME).dis
